<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script>
        // 关键字 new 
        // 获取当前时间
        const date = new Date()
        console.log(date);
        //获取指时间
        const date1 = new Date('2025-11-13')
        console.log(date1);
        


        //获得当前年份
        console.log(date.getFullYear());
        //获取当前月份  取值(0~11)
        console.log(date.getMonth())
        //获取月份中的每一天
        console.log(date.getDate())
        //获取星期 取值(0~6)
        console.log(date.getDay())
        //获取小时，分钟，秒
        console.log(date.getHours())
        console.log(date.getMinutes())
        console.log(date.getSeconds())
    </script>

</body>
</html>